
#ifndef VXTEXTITEM_H
#define VXTEXTITEM_H

#include <QGraphicsTextItem>
#include <QPen>

QT_BEGIN_NAMESPACE
class QFocusEvent;
class QGraphicsItem;
class QGraphicsScene;
class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE

class GetOutLines;

class VxTextItem : public QGraphicsTextItem
{
    Q_OBJECT

public:
	enum {
		Type = UserType + 3
	};

	VxTextItem(QGraphicsItem *parent = 0, QGraphicsScene *scene = 0);

    int type() const
        { return Type; }

	void loadExample();

	QGraphicsItem * getOutLines(QGraphicsItemGroup * destinaion);

signals:
	void lostFocus(VxTextItem *item);
    void selectedChange(QGraphicsItem *item);

protected:
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);
    void focusOutEvent(QFocusEvent *event);
    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
	void keyPressEvent(QKeyEvent *event);

private:
	QGraphicsScene * _scene;
	GetOutLines * _thread;
	QGraphicsItemGroup * _destination;

private slots:
	void _finishedThread();
	void _outLineGenerate(QPainterPath *);


};


#endif
